﻿//颜色常量
var color = {
    transparentBlack: "rgba(0 ,0 ,0, 0)",
    transparentWhite: "rgba(255 ,255 ,255, 0)",
    aliceBlue: "rgb(240 ,248 ,255)",
    antiqueWhite: "rgb(250 ,235 ,215)",
    aqua: "rgb(0 ,255 ,255)",
    aquamarine: "rgb(127 ,255 ,212)",
    azure: "rgb(240 ,255 ,255)",
    beige: "rgb(245 ,245 ,220)",
    bisque: "rgb(255 ,228 ,196)",
    black: "rgb(0 ,0 ,0)",
    blanchedAlmond: "rgb(255 ,235 ,205)",
    blue: "rgb(0 ,0 ,255)",
    blueViolet: "rgb(138 ,43 ,226)",
    brown: "rgb(165 ,42 ,42)",
    burlyWood: "rgb(222 ,184 ,135)",
    cadetBlue: "rgb(95 ,158 ,160)",
    chartreuse: "rgb(127 ,255 ,0)",
    chocolate: "rgb(210 ,105 ,30)",
    coral: "rgb(255 ,127 ,80)",
    cornflowerBlue: "rgb(100 ,149 ,237)",
    cornsilk: "rgb(255 ,248 ,220)",
    crimson: "rgb(220 ,20 ,60)",
    cyan: "rgb(0 ,255 ,255)",
    darkBlue: "rgb(0 ,0 ,139)",
    darkCyan: "rgb(0 ,139 ,139)",
    darkGoldenrod: "rgb(184 ,134 ,11)",
    darkGray: "rgb(169 ,169 ,169)",
    darkGreen: "rgb(0 ,100 ,0)",
    darkKhaki: "rgb(189 ,183 ,107)",
    darkMagenta: "rgb(139 ,0 ,139)",
    darkOliveGreen: "rgb(85 ,107 ,47)",
    darkOrange: "rgb(255 ,140 ,0)",
    darkOrchid: "rgb(153 ,50 ,204)",
    darkRed: "rgb(139 ,0 ,0)",
    darkSalmon: "rgb(233 ,150 ,122)",
    darkSeaGreen: "rgb(143 ,188 ,139)",
    darkSlateBlue: "rgb(72 ,61 ,139)",
    darkSlateGray: "rgb(47 ,79 ,79)",
    darkTurquoise: "rgb(0 ,206 ,209)",
    darkViolet: "rgb(148 ,0 ,211)",
    deepPink: "rgb(255 ,20 ,147)",
    deepSkyBlue: "rgb(0 ,191 ,255)",
    dimGray: "rgb(105 ,105 ,105)",
    dodgerBlue: "rgb(30 ,144 ,255)",
    firebrick: "rgb(178 ,34 ,34)",
    floralWhite: "rgb(255 ,250 ,240)",
    forestGreen: "rgb(34 ,139 ,34)",
    fuchsia: "rgb(255 ,0 ,255)",
    gainsboro: "rgb(220 ,220 ,220)",
    ghostWhite: "rgb(248 ,248 ,255)",
    gold: "rgb(255 ,215 ,0)",
    goldenrod: "rgb(218 ,165 ,32)",
    gray: "rgb(128 ,128 ,128)",
    green: "rgb(0 ,128 ,0)",
    greenYellow: "rgb(173 ,255 ,47)",
    honeydew: "rgb(240 ,255 ,240)",
    hotPink: "rgb(255 ,105 ,180)",
    indianRed: "rgb(205 ,92 ,92)",
    indigo: "rgb(75 ,0 ,130)",
    ivory: "rgb(255 ,255 ,240)",
    khaki: "rgb(240 ,230 ,140)",
    lavender: "rgb(230 ,230 ,250)",
    lavenderBlush: "rgb(255 ,240 ,245)",
    lawnGreen: "rgb(124 ,252 ,0)",
    lemonChiffon: "rgb(255 ,250 ,205)",
    lightBlue: "rgb(173 ,216 ,230)",
    lightCoral: "rgb(240 ,128 ,128)",
    lightCyan: "rgb(224 ,255 ,255)",
    lightGoldenrodYellow: "rgb(250 ,250 ,210)",
    lightGreen: "rgb(144 ,238 ,144)",
    lightGray: "rgb(211 ,211 ,211)",
    lightPink: "rgb(255 ,182 ,193)",
    lightSalmon: "rgb(255 ,160 ,122)",
    lightSeaGreen: "rgb(32 ,178 ,170)",
    lightSkyBlue: "rgb(135 ,206 ,250)",
    lightSlateGray: "rgb(119 ,136 ,153)",
    lightSteelBlue: "rgb(176 ,196 ,222)",
    lightYellow: "rgb(255 ,255 ,224)",
    lime: "rgb(0 ,255 ,0)",
    limeGreen: "rgb(50 ,205 ,50)",
    linen: "rgb(250 ,240 ,230)",
    magenta: "rgb(255 ,0 ,255)",
    maroon: "rgb(128 ,0 ,0)",
    mediumAquamarine: "rgb(102 ,205 ,170)",
    mediumBlue: "rgb(0 ,0 ,205)",
    mediumOrchid: "rgb(186 ,85 ,211)",
    mediumPurple: "rgb(147 ,112 ,219)",
    mediumSeaGreen: "rgb(60 ,179 ,113)",
    mediumSlateBlue: "rgb(123 ,104 ,238)",
    mediumSpringGreen: "rgb(0 ,250 ,154)",
    mediumTurquoise: "rgb(72 ,209 ,204)",
    mediumVioletRed: "rgb(199 ,21 ,133)",
    midnightBlue: "rgb(25 ,25 ,112)",
    mintCream: "rgb(245 ,255 ,250)",
    mistyRose: "rgb(255 ,228 ,225)",
    moccasin: "rgb(255 ,228 ,181)",
    navajoWhite: "rgb(255 ,222 ,173)",
    navy: "rgb(0 ,0 ,128)",
    oldLace: "rgb(253 ,245 ,230)",
    olive: "rgb(128 ,128 ,0)",
    oliveDrab: "rgb(107 ,142 ,35)",
    orange: "rgb(255 ,165 ,0)",
    orangeRed: "rgb(255 ,69 ,0)",
    orchid: "rgb(218 ,112 ,214)",
    paleGoldenrod: "rgb(238 ,232 ,170)",
    paleGreen: "rgb(152 ,251 ,152)",
    paleTurquoise: "rgb(175 ,238 ,238)",
    paleVioletRed: "rgb(219 ,112 ,147)",
    papayaWhip: "rgb(255 ,239 ,213)",
    peachPuff: "rgb(255 ,218 ,185)",
    peru: "rgb(205 ,133 ,63)",
    pink: "rgb(255 ,192 ,203)",
    plum: "rgb(221 ,160 ,221)",
    powderBlue: "rgb(176 ,224 ,230)",
    purple: "rgb(128 ,0 ,128)",
    red: "rgb(255 ,0 ,0)",
    rosyBrown: "rgb(188 ,143 ,143)",
    royalBlue: "rgb(65 ,105 ,225)",
    saddleBrown: "rgb(139 ,69 ,19)",
    salmon: "rgb(250 ,128 ,114)",
    sandyBrown: "rgb(244 ,164 ,96)",
    seaGreen: "rgb(46 ,139 ,87)",
    seaShell: "rgb(255 ,245 ,238)",
    sienna: "rgb(160 ,82 ,45)",
    silver: "rgb(192 ,192 ,192)",
    skyBlue: "rgb(135 ,206 ,235)",
    slateBlue: "rgb(106 ,90 ,205)",
    slateGray: "rgb(112 ,128 ,144)",
    snow: "rgb(255 ,250 ,250)",
    springGreen: "rgb(0 ,255 ,127)",
    steelBlue: "rgb(70 ,130 ,180)",
    tan: "rgb(210 ,180 ,140)",
    teal: "rgb(0 ,128 ,128)",
    thistle: "rgb(216 ,191 ,216)",
    tomato: "rgb(255 ,99 ,71)",
    turquoise: "rgb(64 ,224 ,208)",
    violet: "rgb(238 ,130 ,238)",
    wheat: "rgb(245 ,222 ,179)",
    white: "rgb(255 ,255 ,255)",
    whiteSmoke: "rgb(245 ,245 ,245)",
    yellow: "rgb(255 ,255 ,0)",
    yellowGreen: "rgb(154 ,205 ,50)"
};

//按键常量
var keys = {
    none: 0,
    back: 8,
    tab: 9,
    enter: 13,
    pause: 19,
    capslock: 20,
    kana: 21,
    kanji: 25,
    escape: 27,
    imeconvert: 28,
    imenoconvert: 29,
    space: 32,
    pageup: 33,
    pagedown: 34,
    end: 35,
    home: 36,
    left: 37,
    up: 38,
    right: 39,
    down: 40,
    select: 41,
    print: 42,
    execute: 43,
    printscreen: 44,
    insert: 45,
    del: 46,
    help: 47,
    d0: 48,
    d1: 49,
    d2: 50,
    d3: 51,
    d4: 52,
    d5: 53,
    d6: 54,
    d7: 55,
    d8: 56,
    d9: 57,
    a: 65,
    b: 66,
    c: 67,
    d: 68,
    e: 69,
    f: 70,
    g: 71,
    h: 72,
    i: 73,
    j: 74,
    k: 75,
    l: 76,
    m: 77,
    n: 78,
    o: 79,
    p: 80,
    q: 81,
    r: 82,
    s: 83,
    t: 84,
    u: 85,
    v: 86,
    w: 87,
    x: 88,
    y: 89,
    z: 90,
    leftwindows: 91,
    rightwindows: 92,
    apps: 93,
    sleep: 95,
    numpad0: 96,
    numpad1: 97,
    numpad2: 98,
    numpad3: 99,
    numpad4: 100,
    numpad5: 101,
    numpad6: 102,
    numpad7: 103,
    numpad8: 104,
    numpad9: 105,
    multiply: 106,
    add: 107,
    separator: 108,
    subtract: 109,
    decimal: 110,
    divide: 111,
    f1: 112,
    f2: 113,
    f3: 114,
    f4: 115,
    f5: 116,
    f6: 117,
    f7: 118,
    f8: 119,
    f9: 120,
    f10: 121,
    f11: 122,
    f12: 123,
    f13: 124,
    f14: 125,
    f15: 126,
    f16: 127,
    f17: 128,
    f18: 129,
    f19: 130,
    f20: 131,
    f21: 132,
    f22: 133,
    f23: 134,
    f24: 135,
    numlock: 144,
    scroll: 145,
    leftshift: 160,
    rightshift: 161,
    leftcontrol: 162,
    rightcontrol: 163,
    leftalt: 164,
    rightalt: 165,
    browserback: 166,
    browserforward: 167,
    browserrefresh: 168,
    browserstop: 169,
    browsersearch: 170,
    browserfavorites: 171,
    browserhome: 172,
    volumemute: 173,
    volumedown: 174,
    volumeup: 175,
    medianexttrack: 176,
    mediaprevioustrack: 177,
    mediastop: 178,
    mediaplaypause: 179,
    launchmail: 180,
    selectmedia: 181,
    launchapplication1: 182,
    launchapplication2: 183,
    oemsemicolon: 186,
    oemplus: 187,
    oemcomma: 188,
    oemminus: 189,
    oemperiod: 190,
    oemquestion: 191,
    oemtilde: 192,
    chatpadgreen: 202,
    chatpadorange: 203,
    oemopenbrackets: 219,
    oempipe: 220,
    oemclosebrackets: 221,
    oemquotes: 222,
    oem8: 223,
    oembackslash: 226,
    processkey: 229,
    oemcopy: 242,
    oemauto: 243,
    oemenlw: 244,
    attn: 246,
    crsel: 247,
    exsel: 248,
    eraseeof: 249,
    play: 250,
    zoom: 251,
    pa1: 253,
    oemclear: 254
};

//数学常量
var math = {
    pi: 3.1415,
    e: 2.7182,
    log10E: 0.4342,
    log2E: 1.4427,
    piOver2: 1.5708,
    piOver4: 0.7853,
    twoPi: 6.2831
};